package cn.stylefeng.guns.modular.business.mapper;

import cn.stylefeng.guns.modular.business.entity.UserProperty;
import cn.stylefeng.guns.modular.business.model.dto.KeyValueDTO;
import cn.stylefeng.guns.modular.business.model.params.UserIdsParam;
import cn.stylefeng.guns.modular.business.model.params.UserPropertyParam;
import cn.stylefeng.guns.modular.business.model.params.UserTeamParam;
import cn.stylefeng.guns.modular.business.model.result.UserPropertyResult;
import cn.stylefeng.guns.modular.business.model.result.UserTeamResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户属性表 Mapper 接口
 * </p>
 *
 * @author jwj
 * @since 2019-07-19
 */
@Repository
public interface UserPropertyMapper extends BaseMapper<UserProperty> {

    /**
     * 获取列表
     *
     * @author jwj
     * @Date 2019-07-19
     */
    List<UserPropertyResult> customList(@Param("paramCondition") UserPropertyParam paramCondition);

    /**
     * 获取map列表
     *
     * @author jwj
     * @Date 2019-07-19
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") UserPropertyParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author jwj
     * @Date 2019-07-19
     */
    Page<UserPropertyResult> customPageList(@Param("page") Page page, @Param("paramCondition") UserPropertyParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author jwj
     * @Date 2019-07-19
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") UserPropertyParam paramCondition);


    /**
     * 分页获取我的推广列表
     * @param page
     * @param userTeamParam
     * @return
     */
    Page<UserTeamResult> getMyPushPage(@Param("page") Page page, @Param("teamParam") UserTeamParam userTeamParam);

    /**
     * 获取我的推广列表总数
     * @return
     */
    Long getMyPushCount(@Param("teamParam") UserTeamParam userTeamParam);
    /**
     * 获取我的直推个数
     * @param userTeamParam
     * @return
     */
    List<UserTeamResult> getZPushListByIds(@Param("userIdsParam") UserIdsParam userTeamParam);


    /**
     * 获取间推个数
     * @return
     */
    List<UserTeamResult> getJPushListByIds(@Param("userIdsParam") UserIdsParam userIdsParam);

    /**
     * 获取我的团队人数
     * @param userId
     * @return
     */
    Long getMyTeamTotal(@Param("userId") Long userId);

    /**
     * //获取所有用户等级
     *
     * @param userIdList
     * @return
     */
    List<KeyValueDTO<Integer>> getUserGradeLevel(@Param("userIdList") List<Long> userIdList);
}
